﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="uploadTest1.MFUpload"
	d:DesignWidth="382" d:DesignHeight="242">
	<UserControl.Resources>
		<Style x:Key="itemRemoveButton" TargetType="Button">
			<Setter Property="Background" Value="#FF1F3B53"/>
			<Setter Property="Foreground" Value="#FF000000"/>
			<Setter Property="Padding" Value="3"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="BorderBrush">
				<Setter.Value>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FFA3AEB9" Offset="0"/>
						<GradientStop Color="#FF8399A9" Offset="0.375"/>
						<GradientStop Color="#FF718597" Offset="0.375"/>
						<GradientStop Color="#FF617584" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid Margin="0,1,1,0">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimation Duration="0" To="#69FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="FaceBG_Copy" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="Unfocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Grid x:Name="face" Margin="0" RenderTransformOrigin="0.5,0.5">
								<Grid.RenderTransform>
									<CompositeTransform ScaleX="0.8" ScaleY="0.8"/>
								</Grid.RenderTransform>
								<Ellipse x:Name="FaceBG" Fill="{TemplateBinding Background}" Margin="1" RenderTransformOrigin="0.5,0.5">
									<Ellipse.RenderTransform>
										<CompositeTransform ScaleY="-1"/>
									</Ellipse.RenderTransform>
								</Ellipse>
								<Ellipse x:Name="FaceRadialGreadient">
									<Ellipse.Fill>
										<RadialGradientBrush Center="0.476,0.476" GradientOrigin="0.476,0.476" RadiusY="0.528" RadiusX="0.528">
											<GradientStop Color="Black" Offset="1"/>
											<GradientStop Color="#4BFFFFFF" Offset="0.701"/>
										</RadialGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
								<Ellipse x:Name="FaceBG_Copy" Margin="1" RenderTransformOrigin="0.5,0.5" Fill="Transparent">
									<Ellipse.RenderTransform>
										<CompositeTransform ScaleY="-1"/>
									</Ellipse.RenderTransform>
								</Ellipse>
							</Grid>
							<Grid x:Name="rim">
								<Grid.OpacityMask>
									<RadialGradientBrush>
										<GradientStop Offset="0"/>
										<GradientStop Color="White" Offset="0.883"/>
										<GradientStop Color="#005B5B5B" Offset="0.863"/>
									</RadialGradientBrush>
								</Grid.OpacityMask>
								<Ellipse x:Name="BGround" Fill="{TemplateBinding Background}" d:LayoutOverrides="VerticalAlignment"/>
								<Ellipse x:Name="RadialGradient" d:LayoutOverrides="VerticalAlignment">
									<Ellipse.Fill>
										<RadialGradientBrush>
											<GradientStop Color="Transparent" Offset="0.85"/>
											<GradientStop Color="White" Offset="1"/>
											<GradientStop Color="#99FFFFFF" Offset="0.947"/>
											<GradientStop Color="#99FFFFFF" Offset="0.9"/>
										</RadialGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
							</Grid>
							<ContentPresenter  x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="0,-2,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<DataTemplate x:Key="FileItems">
			<Grid x:Name="FileListItem" MouseEnter="FileListItem_MouseEnter" MouseLeave="FileListItem_MouseLeave">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="0.05*"/>
					<ColumnDefinition Width="0.475*"/>
					<ColumnDefinition Width="0.475*"/>
				</Grid.ColumnDefinitions>									
				<Grid Grid.Column="2">
					<Grid.ColumnDefinitions>
						<ColumnDefinition/>
						<ColumnDefinition Width="30"/>
					</Grid.ColumnDefinitions>
					<TextBlock x:Name="length" TextWrapping="Wrap" Text="{Binding Length}" HorizontalAlignment="Right" VerticalAlignment="Center"/>
					<Viewbox Grid.Column="1" HorizontalAlignment="Right" >
						<TextBlock x:Name="unit" TextWrapping="Wrap" Text="bytes" Margin="5,0,0,0" VerticalAlignment="Center" />									
					</Viewbox>									
				</Grid>
				<Button x:Name="deleteBtn" Content="x" Padding="0" Style="{StaticResource itemRemoveButton}" Width="18" Height="18" Margin="0,3,0,2" Foreground="White" Click="deleteBtn_Click" />									
				<TextBlock x:Name="name" TextWrapping="Wrap" Text="{Binding Name}" HorizontalAlignment="Left" Grid.Column="1" Margin="5,0,0,0" VerticalAlignment="Center"/>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot">
		<Grid x:Name="uploadGrid" Margin="0">
			<Grid.RowDefinitions>
				<RowDefinition Height="0.905*"/>
				<RowDefinition Height="0.095*"/>
			</Grid.RowDefinitions>
			<ListBox x:Name="filesLst" Margin="0" ItemTemplate="{StaticResource FileItems}">
				<ListBox.ItemContainerStyle> 
					<Style TargetType="ListBoxItem"> 
						<Setter Property="HorizontalContentAlignment" Value="Stretch"/> 
					</Style> 
				</ListBox.ItemContainerStyle> 
			</ListBox>
			<Grid Grid.Row="1">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="210"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Button x:Name="browseBtn" Content="Browse...." Click="browseBtn_Click" Height="23" Margin="0" Padding="8,3" HorizontalAlignment="Left"/>
                <Button x:Name="clearBtn" Content="Clear" Margin="88,0,77,0" Height="23" Padding="8,3" Click="clearBtn_Click" IsEnabled="False" d:LayoutOverrides="Width" />
				<Button x:Name="UploadButton" Content="Upload" Height="23" IsEnabled="False" Click="Upload_Click" HorizontalAlignment="Right" Width="62" />
				<Grid x:Name="progressArea" Grid.Column="1" Margin="4,1,0,-1" Visibility="Collapsed">
					<ProgressBar x:Name="overallProgress" Margin="0,4" />
					<Viewbox Width="165" HorizontalAlignment="Left" Margin="3,4,0,4">
						<TextBlock x:Name="UploadFileName" TextWrapping="NoWrap" Text="TextBlock" HorizontalAlignment="Left"/>
					</Viewbox>
				</Grid>
			</Grid>
		</Grid>
	</Grid>
</UserControl>